diff -Naur xen/core/gnttab.c xen.patched/core/gnttab.c
--- xen/core/gnttab.c 2005-09-23 10:54:50.000000000 -0600
+++ xen.patched/core/gnttab.c 2005-09-23 10:57:51.000000000 -0600
-@@ -22,6 +22,10 @@
+@@ -19,6 +19,10 @@
#include <asm-xen/gnttab.h>
#include <asm/synch_bitops.h>
+#endif
+
#if 1
- #define ASSERT(_p) \
- if ( !(_p) ) { printk(KERN_ALERT"Assertion '%s': line %d, file %s\n", \
-@@ -339,6 +343,10 @@
- if ( hypercall.op != __HYPERVISOR_grant_table_op )
- return -ENOSYS;
+ #define ASSERT(_p) \
+ if ( !(_p) ) { printk(KERN_ALERT"Assertion '%s': line %d, file %s\n", \
+@@ -346,6 +350,10 @@
+ if ( hypercall.op != __HYPERVISOR_grant_table_op )
+ return -ENOSYS;
+
+#ifdef __ia64__
-+ ret = HYPERVISOR_grant_table_op(hypercall.arg[0], (void *)hypercall.arg[1], hypercall.arg[2]);
++ ret = HYPERVISOR_grant_table_op(hypercall.arg[0], (void *)hypercall.arg[1], hypercall.arg[2]);
+#else
- /* hypercall-invoking asm taken from privcmd.c */
- __asm__ __volatile__ (
- "pushl %%ebx; pushl %%ecx; pushl %%edx; pushl %%esi; pushl %%edi; "
-@@ -351,6 +359,7 @@
- TRAP_INSTR "; "
- "popl %%edi; popl %%esi; popl %%edx; popl %%ecx; popl %%ebx"
- : "=a" (ret) : "0" (&hypercall) : "memory" );
+ /* hypercall-invoking asm taken from privcmd.c */
+ __asm__ __volatile__ (
+ "pushl %%ebx; pushl %%ecx; pushl %%edx; "
+@@ -359,6 +367,7 @@
+ TRAP_INSTR "; "
+ "popl %%edi; popl %%esi; popl %%edx; popl %%ecx; popl %%ebx"
+ : "=a" (ret) : "0" (&hypercall) : "memory" );
+#endif
- return ret;
+ return ret;
}
-@@ -414,8 +423,13 @@
- BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1) != 0);
- BUG_ON(setup.status != 0);
+@@ -423,8 +432,13 @@
+ BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1));
+ BUG_ON(setup.status != 0);
+#ifdef __ia64__
-+ shared = __va(frames[0] << PAGE_SHIFT);
-+ printk("grant table at %p\n", shared);
++ shared = __va(frames[0] << PAGE_SHIFT);
++ printk("grant table at %p\n", shared);
+#else
- for ( i = 0; i < NR_GRANT_FRAMES; i++ )
- set_fixmap(FIX_GNTTAB_END - i, frames[i] << PAGE_SHIFT);
+ for (i = 0; i < NR_GRANT_FRAMES; i++)
+ set_fixmap(FIX_GNTTAB_END - i, frames[i] << PAGE_SHIFT);
+#endif
- return 0;
+ return 0;
}
-@@ -425,8 +439,10 @@
+@@ -434,8 +448,10 @@
{
- int i;
+ int i;
+#ifndef __ia64__
- for ( i = 0; i < NR_GRANT_FRAMES; i++ )
- clear_fixmap(FIX_GNTTAB_END - i);
+ for (i = 0; i < NR_GRANT_FRAMES; i++)
+ clear_fixmap(FIX_GNTTAB_END - i);
+#endif
- return 0;
+ return 0;
}
-@@ -441,7 +457,9 @@
+@@ -450,7 +466,9 @@
- BUG_ON(gnttab_resume());
+ BUG_ON(gnttab_resume());
+#ifndef __ia64__
- shared = (grant_entry_t *)fix_to_virt(FIX_GNTTAB_END);
+ shared = (grant_entry_t *)fix_to_virt(FIX_GNTTAB_END);
+#endif
- for ( i = 0; i < NR_GRANT_ENTRIES; i++ )
- gnttab_list[i] = i + 1;
+ for (i = NR_RESERVED_ENTRIES; i < NR_GRANT_ENTRIES; i++)
+ gnttab_list[i] = i + 1;